package com.xiaohong.goods.feign;
import com.xiaohong.goods.pojo.Spu;
import entity.Result;
import entity.StatusCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name="goods-service")
@RequestMapping("/spu")
public interface SpuFeign {

    /***
     * 查询Spu全部数据及其所有sku集合
     * @return
     */
    @GetMapping
    Result<List<Spu>> findAll();

    /***
     * 查询所有已上架Spu其状态正常sku集合
     * @return
     */
    @GetMapping("/market")
    Result<List<Spu>> findAllMarket();

    /***
     * 根据ID查询Spu数据及其sku
     * @param id
     * @return
     */
    @GetMapping("/sku/{id}")
    Result<Spu> findAndSkuById(@PathVariable String id);

    /***
     * 根据ID查询Spu数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Spu> findById(@PathVariable String id);
}
